package com.mazaiting.blog.service

import com.mazaiting.blog.domain.User
import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner

@RunWith(SpringRunner::class)
@EnableAutoConfiguration
@SpringBootTest
class UserServiceTest {
    @Autowired
    private lateinit var service: UserService

    @Test
    fun register() {
        val user = User("linghaoyu", "linghaoyu")
        val msg = service.register(user)
        println(msg)
    }

    @Test
    fun login() {
        val user = User("linghaoyu", "linghaoyu")
        val msg = service.login(user)
        println(msg)
    }
}